/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBean.TX.TCube;

import session.TX.OutletSBRemote;
import entity.Outlet;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Lu Xiaodi
 */
@ManagedBean(name = "displayReservationSettingMB")
@RequestScoped
public class DisplayReservationSettingMB {

    @EJB
    OutletSBRemote outletBean;
    Long outletId;
    Outlet outlet;
    List<Outlet> allOutlets;

    /** Creates a new instance of DisplayManagedBeanRep */
    public DisplayReservationSettingMB() {
    }

    public List<Outlet> getAllOutlets() {
        if (this.allOutlets == null) {
            allOutlets = outletBean.getAllOutlets();
        }
        return allOutlets;
    }

    public Long getOutletId() {
        return outletId;
    }

    public void setOutletId(Long outletId) {
        this.outletId = outletId;
    }

    public Outlet getOutlet() {
        if (this.outletId == null) {
            return null;
        }
        return outletBean.getOutlet(outletId);
    }
}
